#include "Transition.h"
#include "Action.h"
#include "State.h"

//-------------------------------------------------------------------------
CTransition::CTransition(const SmartPtr<CStateBase> &pState, const SmartPtr<CStateBase> &pNextState) : m_pState(pState), m_pNextState(pNextState)
{
}

//-------------------------------------------------------------------------
SmartPtr<CStateBase> &CTransition::GetState()
{
	return m_pState;
}

//-------------------------------------------------------------------------
SmartPtr<CStateBase> &CTransition::GetNextState()
{
	return m_pNextState;
}

//-------------------------------------------------------------------------
void CTransition::AddAction(const CActionPtr &pAction)
{
	m_vActions.push_back(pAction); 
}

//-------------------------------------------------------------------------
u32_t CTransition::GetSizeActions()
{
	return m_vActions.size();
}

//-------------------------------------------------------------------------
CActionPtr CTransition::GetAction(u32_t idx)
{
	return m_vActions[idx];	
}

//-------------------------------------------------------------------------
bool_t CTransition::IsTrigger()
{
	return true;
}

DEFINE_RTTI_CLASS( CTransition, CFSMObject );